import { request } from '@/assets/js/request'
import config from '@/assets/js/config'

export const actions = {
  updateUserInfo ({ commit, state }) {
    request({
      method: 'post',
      url: `${config.apiBase}/api/v0/user/userInfo`,
      data: {
        _id: state.userInfo._id
      }
    }).then(res => {
      if (res.status === 1) commit('userInfo', res.data)
    })
  }
}
